echo Capacity,Current,Volt,Temp,Status,ACR
while [ 1 ]
do

    PER=$(cat /sys/class/power_supply/ds2782-0/capacity)
    CUR=$(cat /sys/class/power_supply/ds2782-0/current_now)
    VOL=$(cat /sys/class/power_supply/ds2782-0/voltage_now)
    TEMP=$(cat /sys/class/power_supply/ds2782-0/temp)
    i2cdump -f -y 1 0x34 2> /dev/null > /tmp/ds2782.txt
    STATUS=$(cat /tmp/ds2782.txt |  grep "00:" | awk -F " "  '{print $3}')
    ACRH=$(cat /tmp/ds2782.txt |  grep "10:" | awk -F " "  '{print $2}')
    ACRL=$(cat /tmp/ds2782.txt |  grep "10:" | awk -F " "  '{print $3}')
    echo $PER,$CUR,$VOL,$TEMP,$STATUS,$ACRH$ACRL
    sleep 1
done
